//
//  FenLeiViewController.m
//  试写学生端
//
//  Created by yishangpin2 on 15/5/8.
//  Copyright (c) 2015年 yishangpin2. All rights reserved.
//

#import "FenLeiViewController.h"

@interface FenLeiViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *width;

@end

@implementation FenLeiViewController
{
    NSTimer *timer;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [UIView animateWithDuration:1.0 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    self.width.constant = 150;
    [UIView animateWithDuration:1.0 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(animatechange) userInfo:nil repeats:YES];
}

- (void)viewDidDisappear:(BOOL)animated{
    
    [timer invalidate];
}


- (void)animatechange{
    if (self.width.constant == 150) {
        self.width.constant = 99;
    }
    else
    {
        self.width.constant = 150;
    }
    //    self.Height1.constant = 45;
    [UIView animateWithDuration:1.0 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    
}
@end
